﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using qman.DataHelp;

public partial class Private_ViewPriceQuotes : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Request.Cookies["cookUser"] != null)
        {
            this.Session["user"] = this.Request.Cookies["cookUser"].Value;
        }
        if (this.Session["user"] != null)
        {
            //DataSet ds1;
            //string sql, user = "", userguid = "";

            //ds1 = DataHelp.DataAccess.getDataSet("select c.name,c.id from accounts a inner join companies c on a.company = c.ID where uname='" + this.Session["user"].ToString() + "'");
            //if (ds1.Tables[0].Rows[0][0].ToString().Trim() != "Ad-Tech")
            //{
            //    user = ds1.Tables[0].Rows[0][0].ToString().Trim();
            //    userguid = ds1.Tables[0].Rows[0][1].ToString();
            //}

            DataSet ds;
            ds = qman.DataHelp.DataAccess.getDataSet("select * from quotes q inner join company_accounts ca on q.company = ca.[user] where q.[user] = '" + this.Session["user"].ToString() + "' order by date desc");
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                this.GridView1.DataSource = ds;
                this.GridView1.DataBind();
            }
            /*ds = DataHelp.DataAccess.getDataSet(this.createQuery("revisions"));
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                this.Datagrid2.DataSource = ds;
                this.Datagrid2.DataBind();
            }*/

        }
    }
}
